package com.ry.bhwktapp.home.ui
// TODO with内置函数和run内置函数几乎一样，不同的是调用方式不一样
fun main() {
    var name = "李元霸"

    //具名函数操作
//    with(name){this 就是name本身
//        println(this)
//    }
    val with1= with(name, ::getLong)
//    println(with1)
    val with2 = with(with1, ::getInfo)
    with(with2,::println)


    //匿名函数操作---有点扯淡
  with(with(with(name){
       length
    }){
       "你名字的长度是$this"
   }){
      println(this)
  }

}

private fun getLong(name:String)= name.length

private fun getInfo(le:Int)= "你名字的长度是$le"

